/**************************************************************
  > File Name: 1.c
  > Author: LuoLiang
  > Mail: 1204553475@qq.com 
  > Created Time: 2022年02月19日 星期六 01时06分49秒
 **************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>
#include <framebuffer.h>

int loop = 1;

void arlm_handle(int s)
{
	write(1, "*", 1);
}

int main(int argc, char **argv)
{
	initEquipment();
	struct itimerval itv, olditv;
	itv.it_interval.tv_sec = 1;
	itv.it_interval.tv_usec = 0;
	itv.it_value.tv_sec = 1;
	itv.it_value.tv_usec = 0;

	signal(SIGALRM, arlm_handle);
	setitimer(ITIMER_REAL, &itv, &olditv);

	struct point p;
	while (loop)
	{
		p = click();
		printf("%d,%d\n", p.x, p.y);
	}
	puts("hehe");
	closeEquipment();
    exit(0);
}
